//
//  esEffectBase.h
//  OGLES2IntroducingPVRTools
//
//  Created by Mahmood1 on 2/26/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#ifndef OGLES2IntroducingPVRTools_esEffectBase_h
#define OGLES2IntroducingPVRTools_esEffectBase_h

#include "OGLES2Tools.h"

// Index to bind the attributes to vertex shaders
enum eAttribute
{
    VERTEX_ARRAY = 0,
    TEXCOORD_ARRAY,
    COLOR_ARRAY,
    NORMAL_ARRAY,
};

class esEffectBase
{
protected:
    int m_iWidth;
    int m_iHeight;
    
    // Camera, Used for making the projection matrix
    float m_fCameraNear;
    float m_fCameraFar;
    float m_fFOV;
    
    PVRTMat4 m_mProjection;
    PVRTMat4 m_mView;
    
    // 3D Model
	CPVRTModelPOD		m_Scene;
    
    // OpenGL handles for shaders, textures and VBOs
    GLuint* m_puiVbo;
    GLuint* m_puiIndexVbo;
    
    GLuint* m_puiVertShader;
    GLuint* m_puiFragShader;
    
public:
    GLuint* m_puiTextureIDs;
    
public:
	esEffectBase();
	~esEffectBase();
    
    void BindTextures(GLuint* puiTextures);
	bool LoadVbos(CPVRTString* pErrorStr);
	void DrawMesh(int i32NodeIndex);
};

#endif
